﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;
using System.Windows;

namespace AssignmentsManage.Converters
{
    public class AddAmountConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null && parameter != null)
            {
                double amt = double.Parse(parameter.ToString());
                double val = (double)value;

                return val + amt;
            }

            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null && parameter != null)
            {
                double amt = double.Parse(parameter.ToString());
                double val = (double)value;

                return val - amt;
            }

            return null;
        }
    }
}
